﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Text;
using System.Transactions;

using Toenda.Foundation.Data;

namespace Toenda.Foundation.Messaging {
	/// <summary>
	/// Provides properties for a specific version of a <see cref="Message" />.
	/// </summary>
	public class EmailMessage : Message {
		#region "Data Object"

		/// <summary>
		/// Gets or sets from email.
		/// </summary>
		/// <value>From email.</value>
		public string FromEmail { get; set; }

		/// <summary>
		/// Gets or sets the target email list.
		/// </summary>
		/// <value>The target email list.</value>
		public List<string> TargetEmailList { get; set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="EmailMessage"/> class.
		/// </summary>
		/// <param name="record"></param>
		public EmailMessage(IDataRecord record)
			: base(record) {
			if(record == null) {
				throw new ArgumentNullException("record");
			}
			this.TargetEmailList = new List<string>();

			//this.FromEmail = (record["FromEmail"] == DBNull.Value ? null : record["sapTicketId"].ToString());
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="EmailMessage"/> class.
		/// </summary>
		public EmailMessage() {
			this.TargetEmailList = new List<string>();
		}

		#endregion
	}
}
